﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ChronoScript_Compiler.Language;

namespace ChronoScript_Compiler.Language.Parser
{
    public partial class Parser
    {
        public LanguageDefinition.CodeBlock ParseBlock()
        {
            LanguageDefinition.CodeBlock block = new LanguageDefinition.CodeBlock();
            if (!(ReadToken() is Tokens.openCurlyBracket))
            {
                Console.WriteLine("Excepted { at " + PeekToken(-1).lineNumber);
            }
            while (!(PeekToken() is Tokens.closeCurlyBracket))
            {
                block.body.Add(parseLine());
            }
            ReadToken();
            return block;
        }
    }
}
